package com.custom.base.http

import android.graphics.Bitmap

import java.io.File

/**
 * 作者：
 * 时间：2017/6/23
 * 说明：回调
 */

class OkHttpCallback {
    //图片回调
    abstract class ImgCallback {
        open fun onStart() {}
        open fun onFailure(e: Exception) {}
        abstract fun onSuccess(bitmap: Bitmap)
        open fun onFinish() {}
    }

    //接口回调
    abstract class Callback {
        open fun onStart() {}
        open fun onFailure(code:Int,msg: String) {}
        abstract fun onSuccess(result: String)
        open fun onSuccessBase(result: String) {}
        open fun onFinish() {}
    }

    //进度回调
    abstract class ProgressCallback {
        open fun onStart() {}
        abstract fun onFailure(e: Exception)
        abstract fun onSuccess(file: File)
        abstract fun onResponseProgress(bytesRead: Long, contentLength: Long, done: Boolean)
        open fun onFinish() {}
    }
}
